﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Summerset.Isbndb.Subjects
{

    /// <summary>
    /// Contains data from one paginated response from the subjects collection.
    /// </summary>
    /// <remarks>
    /// Once this object is loaded, it's properties and the <see cref="SubjectElement"/> that it contains
    /// are immutable.  
    /// 
    /// NOTE:  This is the only class that actually communicates with the ISBNdb API.  All other classes base their data on the data obtained from
    /// the SubjectResponsePage instances.  This is why the first page is always loaded syncronously when a ResponsePageCollection
    /// is initialized.
    /// </remarks>
    public sealed class SubjectResponsePage : ResponsePageBase<SubjectElement>
    {
        #region Constructor 

        /// <summary>
        /// Initializes a new instance of the <see cref="SubjectResponsePage"/> class.
        /// </summary>
        /// <param name="pageNumber">The 1-based number of this page.</param>
        /// <param name="requestUri">The full uri including the request query string.</param>
        public SubjectResponsePage(int pageNumber, Uri requestUri)
            : base(pageNumber, requestUri) { }

        #endregion
        #region Overridden Properties

        /// <summary>
        /// Gets the xpath expression that will be used to retrieve the list element.  
        /// </summary>
        protected override string ListElementXpath
        {
            get { return "//SubjectList"; }
        }

        /// <summary>
        /// Gets the xpath expression that can be used to retrieve the individual elements.
        /// </summary>
        protected override string ElementXpath
        {
            get { return "//SubjectData"; }
        }

        #endregion
    }
}
